package com.llb666.shop.items.api.vo;

import com.llb666.shop.items.domain.entity.bo.ItemsCommentBo;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.Date;
import java.util.List;

/**
 * 用于展示商品评价的VO.
 *
 * @author llb666
 */
@Data
public class ItemsCommentVo {
    /**
     * 评论等级.
     */
    private Integer commentLevel;

    /**
     * 评论内容.
     */
    private String content;

    /**
     * 商品规格名称.
     */
    private String specName;

    /**
     * 发言时间.
     */
    private Date createdTime;

    /**
     * 用户头像.
     */
    private String userFace;

    /**
     * 昵称.
     */
    private String nickname;
    @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
    public interface Converter {
        ItemsCommentVo.Converter INSTANCE = Mappers.getMapper(ItemsCommentVo.Converter.class);

        List<ItemsCommentVo> bo2voList(List<ItemsCommentBo> itemCommentBoList);
    }
}
